using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace SMS.Common.Entities
{
    public class Material
    {
        private string materialID;
        [XmlAttribute("MID")]
        public string MaterialID
        {
            get { return materialID; }
            set { materialID = value; }
        }

        private string materialName;
        [XmlAttribute("MName")]
        public string MaterialName
        {
            get { return materialName; }
            set { materialName = value; }
        }

        private string majorCategory;
        [XmlElement("Major_Category",Order=1)]
        public string MajorCategory
        {
            get { return majorCategory; }
            set { majorCategory = value; }
        }

        private string subCategory;
        [XmlElement("Sub_Category",Order=2)]
        public string SubCategory
        {
            get { return subCategory; }
            set { subCategory = value; }
        }

        private string  packingSpec;
        [XmlElement("Packing_Spec",Order=3)]
        public string  PackingSpec
        {
            get { return packingSpec; }
            set { packingSpec = value; }
        }

        private string baseUnit;
        [XmlElement("Base_Unit",Order=4)]
        public string BaseUnit
        {
            get { return baseUnit; }
            set { baseUnit = value; }
        }

        private string orderUnit;
        [XmlElement("Order_Unit", Order = 5)]
        public string OrderUnit
        {
            get { return orderUnit; }
            set { orderUnit = value; }
        }

        private float unit_Conv_Value;
        [XmlElement("Unit_Conv_Value", Order =6)]
        public float Unit_Conv_Value
        {
            get { return unit_Conv_Value; }
            set { unit_Conv_Value = value; }
        }

        private int maxValue;
        [XmlElement("MaxValue", Order = 7)]
        public int MaxValue
        {
            get { return maxValue; }
            set { maxValue = value; }
        }

        private int minValue;
        [XmlElement("MinValue", Order = 8)]
        public int MinValue
        {
            get { return minValue; }
            set { minValue = value; }
        }

        private string orderCycle;
        [XmlElement("Order_Cycle", Order = 9)]
        public string OrderCycle
        {
            get { return orderCycle; }
            set { orderCycle = value; }
        }

        private string stocktakingCycle;
        [XmlElement("Stocktaking_Cycle", Order = 10)]
        public string StocktakingCycle
        {
            get { return stocktakingCycle; }
            set { stocktakingCycle = value; }
        }

        private string description;
        [XmlElement("Description", Order = 11)]
        public string Description
        {
            get { return description; }
            set { description = value; }
        }

        private string status;
        [XmlElement("Status", Order = 12)]
        public string Status
        {
            get { return status; }
            set { status = value; }
        }

        private string deliveryType;
        [XmlElement("DeliveryType", Order = 13)]
        public string DeliveryType
        {
            get { return deliveryType; }
            set { deliveryType = value; }
        }

        private string storageType;
        [XmlElement("StorageType", Order = 14)]
        public string StorageType
        {
            get { return storageType; }
            set { storageType = value; }
        }

        public Material() { }
        public Material(string id, string name)
        {
            this.materialID = id;
            this.materialName = name;
        }
        public Material(string id, string name, string major_category, string sub_category, string packing_Spec, string base_unit, string order_unit,
                            float unit_conv_value, int max_value, int min_value, string order_cycle, string stocktaking_cycle, string desc, string status, string deliver_type, string storage_type)
        {
            this.materialID = id;
            this.materialName = name;
            this.majorCategory = major_category;
            this.subCategory = sub_category;
            this.packingSpec = packing_Spec;
            this.baseUnit = base_unit;
            this.orderUnit = order_unit;
            this.unit_Conv_Value = unit_conv_value;
            this.maxValue = max_value;
            this.minValue = min_value;
            this.orderCycle = order_cycle;
            this.stocktakingCycle = stocktaking_cycle;
            this.description = desc;
            this.status = status;
            this.deliveryType = deliver_type;
            this.storageType = storage_type;
        }
    }
    [XmlRoot("Root")]
    public class Materials
    {
        [XmlAttribute("Final_Ver_Num")]
        public int Final_Ver_Num;
        [XmlElement("Material")]
        public Material[] materialList;
    }
}
